#! /usr/bin/python

import cwiid
import time

print "Press 1+2 on the wiimote"
wm = cwiid.Wiimote()
wm.led = 1
wm.enable(cwiid.FLAG_MOTIONPLUS)
wm.rpt_mode = cwiid.RPT_BTN | cwiid.RPT_MOTIONPLUS
print "OK, connected"

while True:
    print wm.state
    time.sleep(0.1)



